<?php

namespace App\Console\Commands\OpenShop;

use App\Imports\Ekb\BranchBankImport;
use Illuminate\Console\Command;
use Maatwebsite\Excel\Facades\Excel;

class InitEkbBranchBankCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'OpenShop:InitEkbBranchBank';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '开店 : 初始化易快报支行数据';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        ini_set('memory_limit', '6G');

        $filePath = "/www/tiger-api/storage/ekb/ekb3.xlsx";
        Excel::import(new BranchBankImport(), $filePath);

        return 0;
    }
}
